﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Mine
{

    class SimpleStation : IStation
    {
        private int stones, wagon, id;


        public void Initialize(int wagon, int stones)
        {
            this.wagon = wagon;
            this.stones = stones;
        }


        public int Stones
        {
            get { return stones; }
            set
            {
                stones = value;
            }
        }

        public int Wagon
        {
            get
            {
                return wagon;
            }
            set
            {
                wagon = value;
            }
        }



        public int ID
        {
            get
            {
                return id;
            }
            set
            {
                id = value;
            }
        }

        public double GetConsumption(int Stones)
        {
            return Math.Sqrt(Math.Pow(Math.Sqrt(Stones), Math.PI));
        }

        public virtual double MoveStones(int Amount, IStation Destination)
        {
            double r = GetConsumption(stones);//kiszámoljuk a költésget
            stones -= Amount;//leveszünk Amount követ
            Destination.Stones += Amount;//A célhoz hozzáadjuk
            int t = Wagon;//kicseréljuk a csilléket
            Wagon = Destination.Wagon;
            Destination.Wagon = t;
            return r;
        }

    }
}